package com.java.service.impl;

import com.java.mapper.HouseMapper;
import com.java.service.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @function:
 * @CreateTime: 2021/3/16 20:14
 */
@Service
public class HouseServiceImpl implements HouseService {
    @Autowired
    private HouseMapper houseMapper;

    public List<Map<String, Object>> findRoomType() {
        return houseMapper.findRoomType();
    }

    public boolean saveRooms(String roomnum, String roomstatus, Long roomtypeid) {
        int sum = houseMapper.saveRooms(roomnum,roomstatus,roomtypeid);
        return sum>=1?true:false;
    }

    public boolean getRoomByRoomnum(String roomnum) {
       int num = houseMapper.getRoomByRoomnum(roomnum);
        return num >= 1?false:true;
    }

    public List<Map<String, Object>> findRooms() {
        return houseMapper.findRooms();
    }

    public List<Map<String, Object>> findRoomBystatus() {
        return houseMapper.findRoomBystatus("0");
    }
}
